include("shared.lua")

function ENT:Draw()
	self:DrawModel()	
	
	local Laser = Material( "cable/redlaser" )

	local ID = self:LookupAttachment("light")
	
	if ID then 
		local attach = self:GetAttachment( ID )

		if attach then			
			local Vector1 = attach.Pos
			local Vector2 = Vector1 + self:GetAngles():Forward()*1024
			render.SetMaterial( Laser )
			render.DrawBeam( Vector1, Vector2, 5, 0, 0, Color( 255, 255, 255, 255 ) ) 			
		end
	end

end

function ENT:Think()
	self:NextThink( CurTime() + 0.1 )
	return true
end


function UpdateTarget(um)
	Target = um:ReadEntity()
	print(Target:Name())
end
usermessage.Hook("targetRocket", UpdateTarget)